<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/


Route::namespace('Admin')->prefix('admin')->group(function () {
    Route::get('login',"LoginController@login");
    Route::post('loginpost',"LoginController@loginPost");
    //无权限路由
    Route::get('noaccess','LoginController@noaccess');
});


Route::middleware(['islogin','checkauth'])->namespace('Admin')->prefix('admin')->group(function () {
    Route::get('logout',"LoginController@logout");
//首页
    Route::get('index',"IndexController@index");
    Route::get('welcome',"IndexController@welcome");
    Route::resource('user', 'UserController');
    Route::post('user/checkstatus','UserController@checkStatus');
    Route::post('user/deleteall','UserController@deleteAll');
    Route::resource('role', 'RoleController');
    Route::post('role/checkstatus','RoleController@checkStatus');
    Route::post('role/deleteall','RoleController@deleteAll');
    Route::resource('permission', 'PermissionController');
    Route::post('permission/checkstatus','PermissionController@checkStatus');
    Route::post('permission/deleteall','PermissionController@deleteAll');
    //分类
    Route::resource('category', 'CategoryController');
    Route::post('category/checkorder','CategoryController@checkOrder');
    //文章
    Route::resource('article', 'ArticleController');
    Route::post('article/imgupload','ArticleController@imgUpload');

});
